﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using NHibernate;
using NUnit.Framework;

namespace testHibernate
{
    [TestFixture]
    public class NHibernateSampleFixture
    {
        private ISession _session;
        [TestFixtureSetUp]
        public void TestFixtureSetup()
        {
        }
        [SetUp]
        public void Setup()
        {
            HibernateInstance instance = new HibernateInstance();
            ISessionFactory fac = instance.getSessionFactory();
            _session = fac.OpenSession();

        }
        [Test]
        public void GetCustomerByIdTest()
        {
            HibernateInstance instance = new HibernateInstance();
            ISessionFactory fac = instance.getSessionFactory();
            _session = fac.OpenSession();
            _session.Transaction.Begin();
            Ecreate.Popedom.tSysuser user = new Ecreate.Popedom.tSysuser();
            //user.Id = 111;
            user.Username = "asdf";
            user.Group = null;
            _session.Save(user);
            _session.Transaction.Commit();
        }
    }

}
